package com.arpa.ntocc.common.service;

import com.arpa.core.web.Result;
import com.arpa.ntocc.common.domain.dto.ShipmentDTO;
import com.arpa.ntocc.common.domain.dto.ShipmentFromDTO;
import com.arpa.ntocc.common.domain.entity.Shipment;
import com.arpa.ntocc.common.domain.vo.ShipmentVO;
import com.baomidou.mybatisplus.extension.service.IService;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 货主表 服务类
 * </p>
 *
 * @author liuyj
 * @since 2019-11-27
 */
public interface IShipmentService extends IService<Shipment> {



    /**
     * 通过前台表单保存货主
     *
     * @param entity
     */
    void save(ShipmentFromDTO entity);


    /**
     * 根据code更新实体
     *
     * @param entity
     * @return
     */
    int updateByCode(Shipment entity);

    /**
     * 根据code更新实体
     *
     * @param entity
     * @return
     */
    int updateByCode(ShipmentFromDTO entity);


    /**
     * 查询列表
     *
     * @param shipmentDTO
     * @return
     */
    List<ShipmentVO> queryList(ShipmentDTO shipmentDTO);

    /**
     * 查询合计,包含总数
     *
     * @param shipmentDTO
     * @return
     */
    ShipmentVO queryListSum(ShipmentDTO shipmentDTO);

    /**
     * 根据入驻商编码查询入驻商
     */
    Shipment findShipmentByPartyCode(String partyCode);



    /**
     * 获取详情
     *
     * @param code
     * @return
     */
    ShipmentVO getOneInfo(String code);

    /**
     * 批量删除货主和用户信息，登录信息
     *
     * @param codes
     */
    void removeShipment(List<String> codes);


    /**
     * 使用 货主编号 获取 数据
     * @param serialNumber
     * @return
     */
    Shipment shipmentBySerial(@Param(value = "serialNumber")String serialNumber);

    /**
     * 使用货主 名称 获取数据
     * @param shipmentName
     * @return
     */
    Shipment shipmentBySerialName(@Param(value = "shipmentName")String shipmentName);

    /**
     * 判断货主是否需要复核
     *
     * @param shipmentCodes
     */
    Result judgeRecheck(List<String> shipmentCodes);
}
